#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;

static void display(void)
{
    string s;
    ifstream fin("/home/le062/src/3dtest/test_05/zhuang_shi_ping.obj");
    if(!fin)
        return;

    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POINTS);
    while(fin>>s)
    {
        if(s=="v\0")
        {
            double x,y,z;
            fin>>x>>y>>z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            glVertex3f(x/300,y/300,z/300);
        }
    }
    glEnd();
    glFlush();
}


int main(int argc, char *argv[])
{
    glutInit(&argc, argv);
    glutInitWindowSize(640,480);
    glutInitWindowPosition(10,10);
    glutCreateWindow("GLUT Shapes");
    glutDisplayFunc(display);
    glutMainLoop();
    return EXIT_SUCCESS;
}
